package com.xinzhi.controller;

import com.xinzhi.entity.Result;
import com.xinzhi.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
@Controller
public class RechargeController {
    @Autowired
    IUserInfoService iuserInfoService;

    @RequestMapping("/recharge")
    @ResponseBody
    public Result recharge (Integer loginId,BigDecimal money, HttpServletRequest request){
        if (money != null){
        return iuserInfoService.recharge(loginId,money);
        }else {
            return Result.error(5008,"输入值不能为空");
        }
    }
}
